/**
 * Copyright (C), 2015-2020, XXX有限公司
 * FileName: SysLogController
 * Author:   sky
 * Date:     2020/5/10 10:29
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package cn.szh.controller;

import cn.szh.domain.SysLog;
import cn.szh.service.SysLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author sky
 * @create 2020/5/10
 * @since 1.0.0
 */
@Controller
@RequestMapping("/sysLog")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;
    @RequestMapping("/findAll.do")
    public ModelAndView show(@RequestParam(name = "pageNum")Integer pageNum, @RequestParam(name = "pageSize")Integer pageSize){
        ModelAndView mv=new ModelAndView();
        List<SysLog> syslogs = sysLogService.findAllBypage(pageNum,pageSize);
        PageInfo pageInfo=new PageInfo(syslogs);
        mv.addObject("pageInfo",pageInfo);
        //mv.addObject("sysLogs",syslogs);
        mv.setViewName("syslog-list");
        return mv;
    }
}
